Appointment Scheduling Process API - Implementation Template
Developer guide
The criteria for invoking either or both of the system APIs is defined by each resource implemented:
- Slot —
GETby ID – Requests must be passed to/Appointment/{sourceSystem}/{id}, wheresourceSystemis either "Epic" or "Cerner" to fetch appointment by Id.Search– Requests with parameters such as location, service-type, appointment_type, and date ranges can be sent as parameters to the URL/Slotor/Slot/_searchfor fetching available slots in both EMRs.POSTmethod – Requires parameters to be passed as a URL-encoded payload to/Slotor/Slot/_searchto filter responses on downstream system APIs.
 - Appointment —
GETBy ID (Multiple EMR) – If a A URI parameter is passed to/Appointment/{sourceSystem}/{id}, the system API corresponding tosourceSystemwill be invoked to get Appointment by ID.GETBy ID (Single EMR) – If a URI parameter is passed to/Appointment/{id}, the request is routed to the primary system API as defined in theconfig-{env}.yamlfile.POSTmethod – Requests with "Appointment Create/Cancel" body to/Appointment/{sourceSystem}are routed to system API based onsourceSystem.
 
Following DataWeave modules to be used in Appointment Scheduling(Search,Get,Create,Cancel) and Slot(Get and Search)
| Module | Description | 
|---|---|
| cerner-error-mapping | Generate error message for Cerner Include the request URL and the value cerner | 
| epic-error-mapping | Generate error message for Epic Include the request URL and the value epic | 
| filter_slot_search_form | Generate Slot Search Post Body with updated parameters Parameters include: | 
| noSourceMatch | Generate error response when primary is not configured and request is routed to /Resource without sourceSystem | 
cerner-error-mapping
Generate error message for Cerner
Include the request URL and the value cerner
epic-error-mapping
Generate error message for Epic
Include the request URL and the value epic
filter_slot_search_form
Generate Slot Search Post Body with updated parameters
Parameters include:
Functions
fun filterBySource ( value, filterBy, sourceList)
param
valuestring to be filtered
paramfilterBystring to be used for filtering
paramsourceListis list of sources defined in config-{env}.yamlFilters string to return only matched values Calls helper functions checkSourceinValue and removeString Assumes input string is a comma separated string with multiple values
fun checkSourceinValue ( value, sourceList)
param
valuestring to be checked for sources
paramsourceListis list of sources defined in config-{env}.yamlFunction to check if input string contains one of the sources identified in config-{env}.yaml's defined sources
fun mapStartDates ( startArray)
Generates start dates for Slot Search using payload.start, which is a repeating element
noSourceMatch
Generate error response when primary is not configured
and request is routed to /Resource without sourceSystem